<%@ page language="java" contentType="text/html; charset=EUC-KR"
    pageEncoding="EUC-KR"%>
<%@ page import="performReservation.SMMDBBean"%>
<%@ page import="java.sql.*"%>

<jsp:useBean id="cin" scope="page" class="performReservation.Cinema"/>

<% request.setCharacterEncoding("euc-kr");%>
<%!
	String name = null;
	String phone = null;
	String address = null;
	String info = null;
	
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">

</head>
<body>
	<%
		name = request.getParameter("name");
		phone = request.getParameter("phone");
		address = request.getParameter("address");
		info = request.getParameter("info");
		if(name.equals("")||address.equals("")||phone.equals("")){
			out.println("you need to fill full all the blanks");
			
		}else{
			//insert cinema 
			cin.setAddress(address);
			cin.setInfo(info);
			cin.setName(name);
			cin.setPhone(phone);
			SMMDBBean pProcess = SMMDBBean.getInstance();
			boolean b = pProcess.insertCinema(cin);
			if(b){
				out.println(cin.getName()+"  "+"has been added");
			}else{
				out.println("SQL error");
			}
		}
	%>	
</body>
</html>